import pytest
import requests
import json
@pytest.fixture(name='denglu')
def get_cookie():

    Cookie_url = "http://test.api.7hi.tv/auth/fast-login"
    Cookie_data = {

            "appVersion": "debug3.3.3_test(build333)",
            "channel": "gw",
            "defaultReg": "Y",
            "mobile": "18183842316",
            "phoneModels": "HUAWEI TAS-AN00",
            "systemName": "android",
            "systemVersion": "29",
            "type": "SYS",
            "validateCode": "999999"

    }
    data = json.dumps(Cookie_data)
    header = {"Content-Type": "application/json"}
    r = requests.post(url=Cookie_url,data=data,headers=header)
    cookie = r.cookies.get_dict()
    cookie = '; '.join([f"{k}={v}" for k, v in cookie.items()])
    return cookie